home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!cronkite!news
- From: Marco DeFreitas <mdefreitas@sikorsky.com>
- Subject: Overloading the "new" operator
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <1996Feb6.215339.14166@cronkite.res.utc.com>
- Sender: news@cronkite.res.utc.com
- Nntp-Posting-Host: iris604.asi.sikorsky.com
- Content-Transfer-Encoding: 7bit
- Organization: Sikorsky Aircraft
- Mime-Version: 1.0
- Date: Tue, 6 Feb 1996 21:53:39 GMT
- X-Mailer: Mozilla 1.1S (X11; I; IRIX 5.3 IP12)
- X-Url: news:comp.lang.c++
-
- Hello,
-
- I need to allocate some of my classes from shared memory. I plan to
- overload the new operator to do this. I intend to pre-allocate a chunk
- of shared memory initially, and then just feed people pointers into
- this chunck as requested. These classes will not be deleted, so
- extensive memory management is not a concern. However, my question is:
-
- How can I give a valid pointer? That is, if a class needs to start on a
- word boundry and my last "new" left my shared memory pointer in the
- middle of a word, don't I have a problem? Is it good enough to just
- make sure my pointer is on a double-word boundry at all times? Is this
- method portable? Is there a better way to do this?
-
- Thanks for any input.
-
- --
- Regards,
- Marco DeFreitas
- Sikorsky Aircraft
- Stratford, CT
-
-